SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwrObtenerPlazasDeMovimiento
AS
SELECT    IdCola, MIN(CUPOF) AS CUPOF, MIN(CASE WHEN RectificaA IS NULL THEN SPACE(1) ELSE 'R' END) AS RectificaA,
	MIN(CAusaAlta) CAlta, Min(CausaBaja) CBaja, min(Titularizar) ATitularizar  --Agregado Adriana 2010
FROM         dbo.tb_PlazasDeMovimiento M INNER JOIN
                      dbo.tb_Plazas P ON P.idPlaza = M.idPlaza
GROUP BY M.idCola

GO
GRANT SELECT ON  [dbo].[vwrObtenerPlazasDeMovimiento] TO [PersonalDocente]
GRANT SELECT ON  [dbo].[vwrObtenerPlazasDeMovimiento] TO [PersonalDocenteDireccion]
GRANT SELECT ON  [dbo].[vwrObtenerPlazasDeMovimiento] TO [SoloVer]
GO
